$(function(){
	var year = new Date().getFullYear();
	var month = new Date().getMonth()+1;
	if(month<10)
		month = "0"+month
	var date = (year+"-"+month);
	var empid = $(".He_text_t").attr("id");
	//初始化表格 考勤数据
	
	tableSJ(date,empid);
});

function tableSJ(date,empid){
	$('#YuanGongKaoQinTab').datagrid({
	    url:'YuanGongKaoQinJiLu',
	    queryParams:{
	    	empid:empid,
	    	date:date
	    },
	    columns:[[
			{field:'RESID',checkbox:true,title:'考勤数据编号',width:1,align:'center'},
			{field:'CWASID',title:'所属考勤卡',width:1,align:'center'},
			{field:'EMPNAME',title:'员工姓名',width:1,align:'center'},
			{field:'DEPTNAME',title:'部门',width:1,align:'center'},
			{field:'TEMNAME',title:'班组',width:1,align:'center'},
			{field:'SHFNAME',title:'班次',width:1,align:'center'},
			{field:'SHFTIME',title:'班次时间',width:1,align:'center'},
			{field:'RESMINTIME',title:'打卡签到',width:2,align:'center',
				formatter: function(value,row,index){
					return new Date(value).getFullYear() + '-' + (new Date(value).getMonth() + 1) + '-' + new Date(value).getDate() + ' ' + new Date(value).getHours() + ':' + new Date(value).getMinutes() + ':' + new Date(value).getSeconds();
				}
			},
			{field:'RESMAXTIME',title:'打卡签退',width:2,align:'center',
				formatter: function(value,row,index){
					return new Date(value).getFullYear() + '-' + (new Date(value).getMonth() + 1) + '-' + new Date(value).getDate() + ' ' + new Date(value).getHours() + ':' + new Date(value).getMinutes() + ':' + new Date(value).getSeconds();
				}
			},
			{field:'RESTIME',title:'上班时长',width:1,align:'center'},
			{field:'CWAJG',title:'考勤结果',width:2,align:'center'},
			{field:'RESREM',title:'备注',width:1,align:'center'}
		]],
	    pagination:true,
	    pageNumber:1,
	    pageSize:5,
	    pageList:[5,10,15]
	});
}